<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>自定义数据网格分页器 - jQuery EasyUI 演示</title>
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">
	<script type="text/javascript" src="../../jquery.min.js"></script>
	<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
	<h2 title="Custom DataGrid Pager">自定义数据网格分页器</h2>
	<p title="You can append some buttons to the standard datagrid pager bar.">　　你可以追加一些按钮到数据网格的标准分页器栏上。</p>
	<div style="margin:20px 0;"></div>
	<table id="dg" title="<c>自定义分页器</c>" style="width:630px;height:350px"
			data-options="rownumbers:true,singleSelect:true,pagination:true,url:'datagrid_data1.json',method:'get'">
		<thead>
			<tr>
				<th data-options="field:'itemid',halign:'center'"><h title='Item ID'>物料编码</h></th>
				<th data-options="field:'productid',halign:'right'"><h title='Product ID'>品</h></th>
				<th data-options="field:'productname'"><h title='Product Name'>名</h></th>
				<th data-options="field:'listprice',align:'right',halign:'center'"><h title='List Price'>清单<br/>价格</h></th>
				<th data-options="field:'unitcost',align:'right',halign:'center'"><h title='Unit Cost'>成本<br/>单价</h></th>
				<th data-options="field:'attr1',halign:'center'"><h title='Attribute'>物料属性</h></th>
				<th data-options="field:'status',align:'center'"><h title='Status'>状态</h></th>
			</tr>
		</thead>
	</table>
	<script type="text/javascript">
		$(function(){
			var pager = $('#dg').datagrid().datagrid('getPager');	// get the pager of datagrid
			pager.pagination({
				buttons:[{
					iconCls:'icon-search',
					handler:function(){
						alert('搜索……');
					}
				},{
					iconCls:'icon-add',
					handler:function(){
						alert('新增……');
					}
				},{
					iconCls:'icon-edit',
					handler:function(){
						alert('编辑……');
					}
				}]
			});			
		})
	</script>
</body>
</html>